/**
 * Author: Daniel Michalski
 * Date: 25.02.13
 */

public class Main {
    static void showXY(Coords<?> c) {
        System.out.println("Współrzędne X Y:");

        for (int i = 0; i < c.cords.length; i++)
            System.out.println(c.cords[i].x + " " + c.cords[i].y);

        System.out.println();
    }

    static void showXYZ(Coords<? extends ThreeD> c) {
        System.out.println("Współrzędne X Y Z:");

        for (int i = 0; i < c.cords.length; i++)
            System.out.println(c.cords[i].x + " " +
                    c.cords[i].y + " " +
                    c.cords[i].z);

        System.out.println();
    }

    static void showAll(Coords<? extends FourD> c) {
        System.out.println("Współrzędne X Y Z T:");

        for (int i = 0; i < c.cords.length; i++)
            System.out.println(c.cords[i].x + " " +
                    c.cords[i].y + " " +
                    c.cords[i].z + " " +
                    c.cords[i].t);

        System.out.println();
    }

    public static void main(String[] args) {
        TwoD[] twoDs = {
                new TwoD(0, 0),
                new TwoD(7, 9),
                new TwoD(18, 4),
                new TwoD(-1, -23)
        };

        Coords<TwoD> tdlocs = new Coords<TwoD>(twoDs);

        System.out.println("Zawartość tdlocs:");
        showXY(tdlocs);


        FourD[] fourDs = {
                new FourD(1, 2, 3, 4),
                new FourD(6, 8, 14, 8),
                new FourD(22, 9, 4, 9),
                new FourD(3, -2, -23, 17)
        };

        Coords<FourD> fdlocs = new Coords<FourD>(fourDs);
        System.out.println("Zawartość fdlos:");
        showXY(fdlocs);
        showXYZ(fdlocs);
        showAll(fdlocs);
    }
}
